package Util;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.stereotype.Component;

import java.sql.SQLOutput;

@Component
@Aspect
public class VatUtil {
    //@Before("execution(* com.*Handler.add*(..))")
//    @Before("execution(* service.UserService.login*(..))")
//    public void show(){
//        System.out.println("打开滑块验证！");
//    }
//
//    @After("execution(* service.UserService.login*(..))")
//    public void close(){"execution(* service.UserService.login*(..))"
//        System.out.println("关闭滑块验证！");
//    }
    @Around("execution(* service.UserService.login*(..))")
    public void val(ProceedingJoinPoint pjb){
        System.out.println("弹出滑块验证!");
        try {
            pjb.proceed();
        } catch (Throwable e) {
            //throw new RuntimeException(e);
            System.out.println("验证异常:" + e.toString());
        }
        System.out.println("关闭滑块验证！");
    }
}
